package fpig.io.functions

import fpig.concepts.FunctorDescription;
import fpig.lists.structures.FunList;


class FunListToTokenizedInputStreamFunctor extends FunctorDescription{
	
	static FunctorDescription forToken(token) {
		return new FunListToTokenizedInputStreamFunctor(token: token)
	}
	static FunctorDescription forLineTokenization() {
		return forToken('\n')
	}

    String token
	
	Class mappedFrom(Class a) {
		this.singleMapping(a, FunList.class, InputStream.class)
	}
 
	Closure getFmap() {
		
	    fpig.io.functions.InAndOutOfFunLists.withFunListUsingToken(token)
	}
	
}
